package DesignPatern.A08_调停者模式.A001_问题;

import java.util.Random;

/**
 * @Author: Du
 * @Date: 2021/7/23 8:09
 */
public class Sale
{
    public void sellIBMComputer(int number)
    {
        Stock stock = new Stock();
        Purchase purchase = new Purchase();
        
        if (stock.getStockNumber() < number)
        {
            purchase.buyIBMComputer(number);
        }
        
        System.out.println("销售IBM电脑：" + number + "台");
    }
    
    public int getSaleStatus()
    {
        Random random = new Random();
        int saleCount = random.nextInt(100);
        System.out.println("电脑销售情况：" + saleCount);
        return saleCount;
    }
    
    public void offSale()
    {
        Stock stock = new Stock();
        System.out.println("打折销售电脑：" + stock.getStockNumber());
    }
    
}
